﻿using System;

namespace Agile.DataAccess
{
    /// <summary>
    /// 
    /// </summary>
    public interface IDbCommand : IExecute, IExecuteReturnLastId, IQuery, IParameterValue, IDisposable
    {
        /// <summary>
        /// 
        /// </summary>
        DbCommandData Data { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="parameterType"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        IDbCommand ParameterOut(string name, DataTypes parameterType, int size = 0);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="parameterType"></param>
        /// <param name="direction"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        IDbCommand Parameter(string name, object value, DataTypes parameterType = DataTypes.Object, ParameterDirection direction = ParameterDirection.Input, int size = 0);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        IDbCommand Parameters(params object[] parameters);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        IDbCommand Script(string sql);
        /// <summary>
        /// 
        /// </summary>
        IDbCommand ClearSql { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbCommandType"></param>
        /// <returns></returns>
        IDbCommand CommandType(DbCommandTypes dbCommandType);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="useMultipleResultsets"></param>
        /// <returns></returns>
        IDbCommand UseMultiResult(bool useMultipleResultsets);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="itemsPerPage"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        IDbCommand Paging(int currentPage, int itemsPerPage, string orderBy = null);
    }
}
